<template>
    <menu-bar :todoList="list">
        <template v-slot:item0>
           <p>选择场景</p> 
            <select name="sceneSelect" v-model="sceneSelected" @change="getSceneSelected">
                <option value="-1">---请选择---</option>
                <option :value="index" v-for="scene,index in sceneList" :key="index">{{scene.name}}</option>
            </select>
        </template>

    </menu-bar>
</template>
<script type="module">
import MenuBar from '@/components/MenuBar'
import ConstValue from '@/assets/js/ConstValue'
export default{
    components:{
        MenuBar
    },
    data(){
        return{
            sceneSelected: -1,
            list:['加载场景','保存场景'],
            sceneList:ConstValue.SCENES,
        }
    },
    methods:{
        getSceneSelected(){
            let sceneJson =this.sceneList[this.sceneSelected];
            if(sceneJson){
                global.sceneUtil.loadScene(sceneJson);
            }
        }
    }
}
</script>